package com.taxshare.operation.remote;


import com.taxshare.operation.view.dto.ResourceDTO;
import com.taxshare.response.beans.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @ClassName: ManagerClientService
 * @Description: manager远程调用
 * @author: luozhongyi
 * @date: 2021/2/22 9:41
 */
@FeignClient(name = "tax-manager", fallback = ManagerClientService.HystrixFallBack.class)
@Component
public interface ManagerClientService {

    /**
     * 同步全部资源
     */
    @RequestMapping(value = "/init/system", method = RequestMethod.GET)
    Response initSystem(List<ResourceDTO> resourceDTOS);


    @Component
    class HystrixFallBack implements ManagerClientService {
        @Override
        public Response initSystem(List<ResourceDTO> resourceDTOS) {
            return null;
        }

    }
}
